home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / SRS / server / src / misc / timezone.c < prev   
Encoding:
C/C++ Source or Header  |  2000-01-12  |  562 b   |  26 lines

  1. #include <time.h>
  2. #include <stdio.h>
  3.  
  4. int main(int argc, char **argv)
  5. {
  6.    long int mstinsec, timeinsec, gmtinsec;
  7.  
  8.    long int mininhour = 60;
  9.    long int secinhour = 3600;
  10.  
  11.    tzset();
  12.  
  13.    mstinsec  = timezone;
  14.    timeinsec = time(NULL);
  15.    gmtinsec  = timeinsec - mstinsec;
  16.  
  17.    printf("local timezone: %s\n", tzname[0]);
  18.  
  19.    printf("%s = %ld hours, %ld minutes, or %ld seconds from GMT\n\n", 
  20.           tzname[0], mstinsec / secinhour, mstinsec / mininhour, mstinsec);
  21.  
  22.    printf("local time(): %ld, GMT time() = %ld\n", timeinsec, gmtinsec);
  23.  
  24.    return 0;
  25. }
  26.